﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;

class RotWidget : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
    bool m_IsFoucs = false;
    public Slider m_Slider = null;
    public AndroidControlePanel m_AndroidPanel = null;
    void Awake()
    {
    }
    void Start()
    {
    }
    void Update()
    {
        if(m_Slider)
        {
            if (!m_IsFoucs)
            {

                m_Slider.value = 0;
            }
            m_AndroidPanel.OnRotChanged(m_Slider.value);
        }
    }
    public void OnPointerDown(PointerEventData eventData)
    {
        m_IsFoucs = true;
    }

    public void OnPointerUp(PointerEventData eventData)
    {
        m_IsFoucs = false;
    }

}